<template>
    <div class="film-source" v-if="source">
        <span class="star-img" :class="index<score ? 'open' : 'close'" v-for="(item,index) in 5" :key="index"></span>
        <span class="star-source">{{ score }}</span>
    </div>
    <div class="film-source" v-else>
        <span class="star-tip">暂无评分</span>
    </div>
</template>

<script>
export default {
    props:{
        source:String
    },
    computed: {
        score(){
            return (this.source * 1).toFixed(1)
        },
    },
}
</script>

<style lang="less" scoped>
    
</style>